<template>
  <div class="route-info card">
    <h2 class="section-title">路线信息</h2>
    
    <div class="map-container">
      <!-- 这里集成地图组件，可以使用高德地图或百度地图 -->
      <div class="map" ref="mapRef"></div>
    </div>

    <div class="info-section">
      <h3>集合地点</h3>
      <p>{{ address }}</p>
    </div>

    <div class="info-section">
      <h3>路线说明</h3>
      <p>{{ routeDescription }}</p>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue';

const props = defineProps({
  location: {
    type: String,
    required: true
  },
  address: {
    type: String,
    required: true
  },
  routeDescription: {
    type: String,
    required: true
  }
});

const mapRef = ref(null);

onMounted(() => {
  // 初始化地图
  // 这里需要集成具体的地图 SDK
});
</script>

<style scoped lang="scss">
.route-info {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;

  .section-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
  }

  .map-container {
    width: 100%;
    height: 200px;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;

    .map {
      width: 100%;
      height: 100%;
    }
  }

  .info-section {
    margin-bottom: 16px;

    h3 {
      font-size: 16px;
      font-weight: bold;
      margin: 0 0 8px;
      color: #333;
    }

    p {
      margin: 4px 0;
      color: #666;
      line-height: 1.5;
    }
  }
}
</style>
